


<style scoped>
.el-row{
  height: 100%;
}

.el-menu{
  border-right:none;
}
.el-aside{
  border-right: 1px solid #f5f1f1;
}
.font-color {
  color: red;
}
</style>

<template>
  <el-aside width="200px">
    <el-row class="tac">
        <el-menu
          default-active="1"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
        >
          <el-menu-item index="1" @click="href(thirdpart)">
            <i class="el-icon-menu"></i>
            <span slot="title" >后台中心</span>
          </el-menu-item>
          <el-link href="https://baidu.com" type="success">成功链接</el-link>
          <el-menu-item index="2" @click="goPage('order')">
            <i class="el-icon-s-order"></i>
            <span slot="title">订单列表</span>
          </el-menu-item>

          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>测试3</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="3-1">测试3-1</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
    </el-row>
  </el-aside>
</template>

<script>
import openWindow from '@/util/open-window'
var $this = {};
export default {
  data() {
    return {};
  },
  beforeCreate() {
    $this = this;
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },

    goPage(link) {
      if (link === "home") {
        $this.$router.push("/").catch(error => error);
      } else if ((link == "order")) {
        $this.$router.push("/order").catch(error => error);
      } else {}
    },
    href(thirdpart){
      debugger
          //  alert('ok')
       //this.$store.commit('SET_AUTH_TYPE', thirdpart)
      // const appid = 'xxxxx'
      // const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/auth-redirect')
      const url = 'https://baidu.com'
      //?appid=' + appid + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=snsapi_login#wechat_redirect'
      openWindow(url, thirdpart, 540, 540)
    }
  }
};
</script>
